#include <cstdint>

#include "TxDNN/txdnn.h"
#include "layers/rope/rope.h"

extern "C" txdnnStatus_t TXDNNAPI
txdnnRopeForward(txdnnHandle_t handle,
                 const txdnnTensorDescriptor_t xDesc,
                 const void* x,
                 const txdnnTensorDescriptor_t cosDesc,
                 const void* cos,
                 const txdnnTensorDescriptor_t sinDesc,
                 const void* sin,
                 const txdnnTensorDescriptor_t yDesc,
                 void* y) {
  // TODO print parameters

  // TODO make sure void* or const void* types are correct
  return txdnn::TxdnnTry([&] {
    // to call internal implementation
    txdnn::RopeForward(txdnn::define_obj(handle),
                       txdnn::define_obj(xDesc),
                       x,
                       txdnn::define_obj(cosDesc),
                       cos,
                       txdnn::define_obj(sinDesc),
                       sin,
                       txdnn::define_obj(yDesc),
                       y);
  });
}